<?php
require dirname(__FILE__).'/../inc/inc.php';

$id=intval($id);
$row=$db->find('wb_jinrong_info',$id);
//页面不存在
if (empty($row)) {
	include PATH_ROOT.'/404.php';
	exit();
}
//访问次数+1
$db->query("UPDATE wb_jinrong_info SET hit=hit+1 WHERE id={$id}");
$as_type=$row['as_type'];

//配置页面信息
$page_config=array(
	'title' => $row['title'].$page_title_type_name.'_红枫财务',
	'keywords' => $row['keywords'],
	'description' => $row['description'],
    'css' => array('base','info'),
);

//获取上一条内容
$sql="SELECT id,title FROM wb_jinrong_info WHERE as_type={$as_type} AND id>{$id} ORDER BY id ASC";
$pre_rs=$db->getOne($sql);
$pre_html=$pre_rs?'<a href="./content_'.$pre_rs['id'].'.html" title="'.$pre_rs['title'].'" class="prev">上一条</a>':'没有上一条记录';
//获取下一条内容
$sql="SELECT id,title FROM wb_jinrong_info WHERE as_type={$as_type} AND id<{$id} ORDER BY id DESC";
$next_rs=$db->getOne($sql);
$next_html=$next_rs?'<a href="./content_'.$next_rs['id'].'.html" title="'.$next_rs['title'].'" class="next">下一条</a>':'没有上一条记录';

//导入头部文件
require PATH_INC.'/header.php';
?>
	
	<div class="wrap main">
		<?php require dirname(__FILE__).'/sidebar.php'; ?>
		<div class="PageC fl">
			<div class="position">您的位置：<a href="/">首页</a> &gt; <a href="/info/">资讯问答</a> &gt; <?php echo $cf_jinrong_info_type[$as_type]; ?></div>

			<div class="content">
				<h2><?php echo $row['title']; ?></h2>
				<div class="date">发布时间：<span id="date"><?php echo date('Y-m-d H:i',$row['add_time']); ?></span></div>
				<div class="des">
					<p><?php echo $row['description']; ?></p>
				</div>
				<div class="body"><?php echo $row['content']; ?></div>
			</div>

			<ul class="pages">
				<li><?php echo $pre_html; ?></li>
				<li><?php echo $next_html; ?></li>
			</ul>
		</div>

		<div class="PageR fr">
			<div class="jdzx">
				<h2>用户关注点</h2>
				<dl>
				<?php
				$list=$db->getData("SELECT id,title FROM wb_jinrong_info WHERE as_type={$as_type} ORDER BY hit DESC LIMIT 3");
				foreach ($list as $v) {
					echo '<dd><a href="./content_'.$v['id'].'.html" target="_blank">'.$v['title'].'</a></dd>';
				}
				?>
				</dl>
			</div>

			<div class="yourlike">
				<h2>当前热推</h2>
				<div class="hot">
					<ul>
						<li><img src="/static/images/info/rt1.jpg"></li>
						<li><img src="/static/images/info/rt1.jpg"></li>
						<li><img src="/static/images/info/rt1.jpg"></li>
					</ul>
				</div>
				<ul class="hotpage">
					<li></li>
					<li></li>
					<li></li>
				</ul>
			</div>

			<div class="kefu">
				<a href="javascript:kefuzixun()">在线咨询</a>
			</div>
		</div>
	</div>

	<div class="botcen"></div>
	
	
<?php require PATH_INC.'/footer.php'; ?>

<script src="/static/js/index.js?v1.5"></script>
<script src="/static/js/banner.js?v1221"></script>
<script>
$(function(){
	$('.gonglue li').on('click',function(){
		var array=['抵押贷款','无抵押贷款','个人信用贷款'];
		$('.gonglue li').attr('class','');
		$(this).addClass('selected');
		$('#location3').text(array[$(this).index()]);
		
	})

	$('.question li').on('click',function(){
		$('.question li').attr('class','');
		$(this).addClass('selected');
	})
})
</script>
</body>
</html>

